<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>账号展示</title>
	<%@ include file="/view/common/tags.jsp"%>
	<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"> </script>
</head>
<body>
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-body">
                       <div class="panel panel-default">
                            <div class="panel-body" style="padding-bottom:5px;">
                            	<input id="sourceListJson" type="hidden" value="${sourceListJson}" >
                            	<input id="gameNameListJson" type="hidden" value="${gameNameListJson}" >
                                <form class="form-horizontal" action="/kfManage/list" method="post" id="dataForm">
                                	<input type="hidden" id="token" name="token" value=""/>
                                	<div class="searchMenu">
                                	    <div>
	                                  	    <label>平台：</label>
	                                   		<sk:select cssClass="form-control select" name="platformType" id="platformType" value="" requiredInit="true" ajaxURL="${sysManagerV1}/baseType/select?wm[PARENT_ID]=20">
                                                <option value="">请选择</option>
                                            </sk:select>
	                                    </div>
                                        <div>
                                            <label>项目：</label>
                                            <input type="text" class="form-control" name="projectName" id="projectName" value="" placeholder="输入项目">
                                        </div>
	                                    <div>
                                		    <label>帐号：</label>
                                            <input type="text" class="form-control" name="userName" value=""  placeholder="请输入帐号">
                                        </div>
	                                    <div class="mal10" >
	                                        <button type="button"  class="btn btn-primary btn-sm"  onclick="findData()"><span class='glyphicon glyphicon-search'></span>查&nbsp;询</button>
	                                    </div>
                                	</div>
                                </form>
                            </div>
                        </div>
                        <table class="table table-hover table-condensed table-bordered table-striped" id="dataTable" >
                            <thead>
                                <tr>
                                	<th data-field="index" data-align="center" data-formatter="indexFormatter">序号</th>
                                    <th data-field="platformType" data-align="center" data-formatter="platformTypeFormatter">平台</th>
                                    <th data-field="projectName" data-align="center">项目</th>
                                    <th data-field="userName" data-align="center">账号</th>
                                    <th data-field="kfAccount" data-align="center">被分配人</th>
                                    <th data-field="createTime" data-align="center">分配时间</th>
                                    <th data-field="ticketNum" data-align="center">投票数</th>
                                    <th data-field="rechargeNum" data-align="center">充值数量</th>
                                    <th data-field="failReason" data-align="center">异常原因</th>
                                    <th data-field="updateTime" data-align="center">提交时间</th> 
                                </tr>
                            </thead>
                        </table>
                   	</div>
            	</div>
           	</div>
		</div>
    </section>
   <%@ include file="/view/common/footer.jsp"%>
</body>
<script>

//提示信息
var msgg='<%=request.getAttribute("msg")%>';
if( msgg && msgg!=null && msgg!='null'){ 
   layer.msg(msgg);
}

// 加载table 数据
$(function(){
	 $("#token").val(sessionStorage.getItem("token"));
	 
    $("#dataTable").bootstrapTable({ 
    	url: "/cardOptRecord/history/data",
    	method:"get", 
    	pagination:true,
    	sidePagination:"server",
    	queryParams: function(params) {
            return $.extend({}, params, parseJson(decodeURIComponent($("#dataForm").serialize())));     
        }
   }); 
 })

//查询
function findData(){
    $("#dataTable").bootstrapTable("refresh",{} );
}


//平台名称格式化
function platformTypeFormatter(value, row, index) {
    var html = value;
    $("#platformType option").each(function(){  //遍历所有option    
        var val= $(this).val();   //获取option值     
        if(val == value){    
            html = $(this).text();
            return;
            }    
    });  
    return html;
}

//操作按钮
function buttonFormatter(value, row,index) {
  var e = "<button id='btn_edit' type='button' onclick='getCode("+row.rowId+");'  class='btn btn-default btn-sm'><span class='glyphicon glyphicon-pencil'></span>提取验证码</button>";
  var f = "<button id='btn_edit' type='button' onclick='submitResult("+row.rowId+");'  class='btn btn-default btn-sm'><span class='glyphicon glyphicon-pencil'></span>提交</button>";
  return e + "&nbsp;" + f ;
}
</script>
</html>